package itsm.isperp.module.controller.qingjia; 

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import itsm.isperp.framework.data.domain.PageResponse;
import itsm.isperp.framework.web.controller.BaseProcessController;
import itsm.isperp.framework.web.request.JqGridRequest;
import itsm.isperp.module.entity.qingjia.QjQingjia;
import itsm.isperp.module.service.qingjia.QjQingjiaService;

/**
 * 控制器
 * 
 * @author lizx
 * @date 2016-07-13 11:48
 */
@Controller
@RequestMapping("qingjia/qingjia")
public class QjQingjiaController extends BaseProcessController<QjQingjia> {

	@Autowired
	protected QjQingjiaService qjQingjiaService;

	@Override
	public QjQingjiaService getService() {
		return this.qjQingjiaService;
	}
	
	@Override
	public String getPageTitle() {
		return "请假管理";
	}

	@Override
	public String getProceessKey() {
		// TODO Auto-generated method stub
		return "qingjiaProcess";
	}
	
	@RequestMapping("listData")
	@ResponseBody
	public PageResponse<Map<String, Object>> listData(JqGridRequest request,
			HttpServletRequest req) {
		return this.getService().findAllDetailByRequest(request).toPage();
	}
	
	@RequestMapping("approveEdit")
	public ModelAndView view(String id, HttpServletRequest req) {
		ModelAndView mv = this.getModelAndView();
		mv.addObject("model", this.getService().findOne(id));
		return mv;
	}
	
}
